<?php
class Itvina_JQuery_Form_Element_DatePicker extends ZendX_JQuery_Form_Element_DatePicker
{
	/*public function init()
	{
		//lấy tham số từ đối tượng datePicker
		$id = $this->getId ();
		$name = $this->getName ();
		$value = $this->getValue ();
		$from_year = $this->getJQueryParam('from_year');
		$to_year = $this->getJQueryParam('to_year');
		$have_check = $this->getJQueryParam('have_check');
		$default_check = $this->getJQueryParam('default_check');
		$default_time = $this->getJQueryParam('default_time');
		$have_empty_option = $this->getJQueryParam('have_empty_option');
		
		//MẶC ĐỊNH GIÁ TRỊ CHO THAM SỐ
		$default_check = $default_check == "" ? 0 : $default_check;
		$default_time = $default_time == "" ? time () : $default_time;
		$have_check = $have_check == "" ? 0 : $have_check;
		$have_empty_option = $have_empty_option == "" ? 0 : $have_empty_option;
		$from_year = $from_year == "" ? date ( 'Y' ) - 3 : $from_year;
		$to_year = $to_year == "" ? date ( 'Y' ) + 3 : $to_year;		
		
		//TẠO GIAO DIỆN
		$tmp_description="";
		//check box
		if ($have_check == 1)
			$tmp_description .= "<input title='Check vào để sử dụng ngày tháng' type='checkbox' name='c_$name' id='c_$name' class='calendar c' " . ($c == 1 ? "checked='checked'" : "") . " value='1'/>";		
		//hộp chọn ngày
		$tmp_description .= "<select id='d_$name' class='calendar d' " . ($c == 1 ? "" : "disabled='disabled'") . " name='d_$name'>";
		if ($have_empty_option == 1)
			$tmp_description .= "<option value='0'>- Chọn -</option>";
		for($j = 1; $j <= 31; $j ++)
		{
			$selected = ($d == $j ? "selected='selected'" : "");
			$tmp_description .= "<option value='$j' $selected>$j</option>";
		}
		$tmp_description .= "</select> ";
		//hộp chọn tháng
		$tmp_description .= "<select id='m_$name' class='calendar m' " . ($c == 1 ? "" : "disabled='disabled'") . " name='m_$name'>";
		if ($have_empty_option == 1)
			$tmp_description .= "<option value='0'>- Chọn -</option>";
		for($j = 1; $j <= 12; $j ++)
		{
			$selected = ($m == $j ? "selected='selected'" : "");
			$tmp_description .= "<option value='$j' $selected>$j</option>";
		}
		$tmp_description .= "</select> ";
		//hộp chọn năm				
		$tmp_description .= "<select id='y_$name' class='calendar y' " . ($c == 1 ? "" : "disabled='disabled'") . " name='y_$name'>";
		if ($have_empty_option == 1)
			$tmp_description .= "<option value='0'>- Chọn -</option>";
		for($j = $from_year; $j <= $to_year; $j ++)
		{
			$selected = ($y == $j ? "selected='selected'" : "");
			$tmp_description .= "<option value='$j' $selected>$j</option>";
		}
		$tmp_description .= "</select> ";
		$description=$this->getDescription ();
		$description.=$tmp_description;
		$this->setDescription ( $description );	
		$this->setAttrib ( 'class', 'i-hasDatepicker' );
		
		//Javascript
		//Events
		$create_script = "function(){alert('d')}";
		if ($have_check == 1)
			$create_script .= "
			$('#c_$name').click(function(){
				var checked=!$('#c_$name').is(':checked');
				$('#m_$name').attr('disabled',checked);
				$('#d_$name').attr('disabled',checked);
				$('#y_$name').attr('disabled',checked);
				$('#$name').attr('disabled',checked);
			});		
			";
		
		//Methods
		$select_script = "
			function (dateText, inst){
				$('#d_$name').val( inst.selectedDay);
				$('#m_$name').val( inst.selectedMonth+1);
				$('#y_$name').val( inst.selectedYear);
		 	}
	 	";
		
		$this->setJQueryParams ( array (
				
		//events
		'create' => new Zend_Json_Expr ( $create_script ), 

		//methods
		'onSelect' => new Zend_Json_Expr ( $select_script ), 
		) );
	}	*/
}